#ifndef VORBISDECODER_HPP
#define VORBISDECODER_HPP

#include "Decoder.hpp"
#include <vorbis/codec.h>
#include <vorbis/vorbisfile.h>

/** @brief Decode vorbis audio file
 * @warning Playback with Portaudio is not smooth, maybe it requires to decode all file on load (on a thread)
 */
class VorbisDecoder : public Decoder {
    private:
        OggVorbis_File vf;
        //float **buffer;
        //bool bufferInitialized;
    public:
        bool load(const char* filename, bool silence=false);
        void close();
        int decode(float *data, unsigned long frames);
        bool seek(unsigned int frame);
};

#endif // VORBISDECODER_HPP
